package ch07;

class _10_SingletonTest {
	public static void main(String args[]) {
//		Singleton s = new Singleton();	// error
		Singleton s1 = Singleton.getInstance();
	}
}

final class Singleton {
	private static Singleton s = new Singleton();
	
	private Singleton() {
		
	}
	
	public static Singleton getInstance() {
		if(s==null) s = new Singleton();
		return s;
	}	
}